package com.tyun.common.im;

import com.tyun.config.ImServerProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author taocongcong
 * @create 2018-07-02 16:52
 */
@Configuration
@EnableConfigurationProperties(ImServerProperties.class)
public class ImServerAutoConfig {

    @Autowired
    ImServerProperties imServerProperties;

    @Bean
    ShowcaseWebsocketStarter showcaseWebsocketStarter() throws Exception{
        ShowcaseWebsocketStarter appStarter = new ShowcaseWebsocketStarter(imServerProperties, ShowcaseWsMsgHandler.me);
        //启动程序
        appStarter.start();
        //返回
        return appStarter;
    }

}
